<?php

//这是修改项目视图

function admin_project_update($thissort){
	//$sorttype=array("","disabled","");
	$fction=1;
	if(!isset($thissort['sortid']))
	{
		$fction=0;
		$thissort['sortname']="";
		$thissort['sortid']='';
		$thissort['sorttype']='';
		if(!isset($thissort['sortupid']))
		{
			$thissort['sortupid']=2;
			$thissort['sortupname']='互评';
		}
		$thissort['sortpoint']='';
		$thissort['sortmax']='';
		$thissort['sortmin']='';
	}

	$sorttype=array("","","","");
	$sorttype[$thissort['sorttype']]="selected";

?>
<div class="admin_projec_update">
	<form action=<?php 
		if($fction)
		{
			echo "'admin.update.project.php'";
		}
		else
		{
			echo "'admin.creat.project.php'";
		}
		?> method="post">
		<table>
			<tr>
				<td>项目名称</td>
				<td>
					<input style="display:none;" class="text" type="text" name="sortid" 
					value=<?php echo "'".$thissort['sortid']."'"; ?> />
					<input class="text" type="text" required name="sortname" 
					value=<?php echo "'".$thissort['sortname']."'"; ?> />
				</td>
			</tr>
			<tr>
				<td>项目类型</td>
				<td>
					<select  name="sorttype" class="text">
						<option <?php echo $sorttype[3]; ?> value="3">分类项</option>
						<option <?php echo $sorttype[2]; ?> value="2">选择等级</option>
						<option <?php echo $sorttype[1]; ?> value="1">填写分数</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>父项目</td>
				<td>
					<input style="display:none;" class="text" type="text" required name="sortupid" 
					value=<?php echo "'".$thissort['sortupid']."'"; ?> />
					<input disabled class="text" type="text" required name="sortupname" 
					value=<?php echo "'".$thissort['sortupname']."'"; ?> />
				</td>
			</tr>
			<tr>
				<td>项目占分</td>
				<td>
					<input class="text" type="text" required name="sortpoint"
					value=<?php echo "'".$thissort['sortpoint']."'"; ?> />
				</td>
			</tr>
			<tr>
				<td>最大分数</td>
				<td>
					<input class="text" type="text" required name="sortmax"
					value=<?php echo "'".$thissort['sortmax']."'"; ?> />
				</td>
			</tr>
			<tr>
				<td>最小分数</td>
				<td>
					<input class="text" type="text" required name="sortmin"
					value=<?php echo "'".$thissort['sortmin']."'"; ?> />
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<?php
					if($fction)
					{
						?>
						<input class="button" type="submit" value="修改" />
						<input class="button" type="button" onclick=<?php echo "'deletep(".$thissort['sortid'].")'" ?> value="删除" />
						<?php
					}
					else
					{
						?>
						<input class="button" type="submit" value="增加" />
						<?php
					}
					?>
					
				</td>
			</tr>
		</table>
	</form>
</div>


<?php
}
?>